package com.wooophone.mpyeah.biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.wooophone.mpyeah.biz.BrandCommentBiz;
import com.wooophone.mpyeah.biz.exception.CannotDeleteException;
import com.wooophone.mpyeah.dao.BrandCommentDao;
import com.wooophone.mpyeah.entity.BrandComment;

public class BrandCommentBizImpl implements BrandCommentBiz {

	@Autowired
	private BrandCommentDao brandCommentDao;

	public void setBrandCommentDao(BrandCommentDao brandCommentDao) {
		this.brandCommentDao = brandCommentDao;
	}

	@Override
	public BrandComment save(BrandComment obj) {
		return brandCommentDao.save(obj);
	}

	@Override
	public int update(BrandComment obj) {
		return brandCommentDao.update(obj);
	}

	@Override
	public int delete(String id) throws CannotDeleteException {
		return brandCommentDao.delete(id);
	}

	@Override
	public BrandComment get(String id) {
		return brandCommentDao.get(id);
	}

	@Override
	public List<BrandComment> list() {
		return brandCommentDao.list();
	}

	@Override
	public List<BrandComment> list(int offset, int limit) {
		Map<String, Object> parameter = new HashMap<String, Object>();
		parameter.put("limit", limit);
		parameter.put("offset", offset);
		return brandCommentDao.list();
	}

	@Override
	public int count() {
		return brandCommentDao.count();
	}

	@Override
	public List<BrandComment> find(Map<String, Object> parameter) {
		return brandCommentDao.find(parameter);
	}

	@Override
	public List<BrandComment> find(Map<String, Object> parameter, int offset,
			int limit) {
		parameter.put("limit", limit);
		parameter.put("offset", offset);
		return brandCommentDao.find(parameter);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return brandCommentDao.count(parameter);
	}

	@Override
	public int count(String keyword) {
		return brandCommentDao.count(keyword);
	}

	@Override
	public List<BrandComment> search(String keyword, int offset, int limit) {
		return brandCommentDao.search(keyword, offset, limit);
	}

	@Override
	public int usefulPlusOne(String id) {
		return brandCommentDao.usefulPlusOne(id);
	}

	@Override
	public int uselessPlusOne(String id) {
		return brandCommentDao.uselessPlusOne(id);
	}

}
